import request from "@/utils/request.ts";
import {HospitalInfo, HospitalLevelAndRegionResponseData, HospitalResponseData} from "@/api/home/type";

enum API {
    // HOSPITAL_URL = 'hosp/hospital/',     //尚硅谷地址
    HOSPITAL_URL = '/hosp/hospital/findHospitalList/',  //本地地址
    HOSPITALLEAVELANDREGION_URL='/cmn/dict/findByDictCode/',
    HOSPITALINFO_URL='/hosp/hospital/findByHosname/'
}

//获取医院的数据
export const reqHospital = (page:number,limit:number,hostype='',districtCode='')=>request.get<any,HospitalResponseData>(API.HOSPITAL_URL+`${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`);
//获取医院的等级或者获取医院地区的数据
export const reqHospitalLevelAndRegion = (dictCode:string)=>request.get<any,HospitalLevelAndRegionResponseData>(API.HOSPITALLEAVELANDREGION_URL+dictCode);
//根据关键字获取医院的数据进行展示
export const reqHospitalInfo = (hosname:string)=>request.get<any,HospitalInfo>(API.HOSPITALINFO_URL+hosname);
